www.gusucode.com > 基于马尔科夫随机场的图像分割matlab源码。包括ICM迭代条件模式求解最大后验概率算法 > code23/matlab MRF toy examples/getCliqueProb.m

    % getCliqueProb(nodes,iNode,k);
% find contribution to total probability for a given state (k) of a given
% node (iNode).   For use in ICM.  oct. 7, 2003 wtr.
function [prob] = getCliqueProb(nodes,iNode,k);

node = nodes{iNode};
prob = node.localEvidence(k);
for nl = 1:node.nLinks
    link = node.links{nl};
    prob = prob * link.propMat(nodes{link.farsIndex}.state,k);
end